package com.taobao.txc.a.b;

import com.taobao.txc.common.c.F;
import com.taobao.txc.common.util.d.a;
import io.netty.buffer.ByteBuf;
import java.io.Serializable;
import java.nio.ByteBuffer;

public class e
  extends F
  implements Serializable
{
  private String b;
  private String c = a.a();
  private short d = 0;
  private String e;
  public ByteBuffer a = ByteBuffer.allocate(1048576);
  
  public e() {}
  
  public e(String paramString)
  {
    this.b = paramString;
    this.d = 0;
    this.e = null;
  }
  
  public void a(String paramString)
  {
    this.b = paramString;
  }
  
  public void b(String paramString)
  {
    this.c = paramString;
  }
  
  public void a(short paramShort)
  {
    this.d = paramShort;
  }
  
  public void c(String paramString)
  {
    this.e = paramString;
  }
  
  public short b_()
  {
    return 103;
  }
  
  public byte[] c()
  {
    if (this.b != null)
    {
      arrayOfByte = this.b.getBytes(j);
      this.a.putInt(arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.a.put(arrayOfByte);
      }
    }
    else
    {
      this.a.putInt(0);
    }
    if (this.c != null)
    {
      arrayOfByte = this.c.getBytes(j);
      this.a.putShort((short)arrayOfByte.length);
      if (arrayOfByte.length > 0) {
        this.a.put(arrayOfByte);
      }
    }
    else
    {
      this.a.putShort((short)0);
    }
    if (this.c != null)
    {
      this.a.putShort(this.d);
      if (this.e != null)
      {
        arrayOfByte = this.e.getBytes(j);
        this.a.putShort((short)arrayOfByte.length);
        if (arrayOfByte.length > 0) {
          this.a.put(arrayOfByte);
        }
      }
      else
      {
        this.a.putShort((short)0);
      }
    }
    this.a.flip();
    byte[] arrayOfByte = new byte[this.a.limit()];
    this.a.get(arrayOfByte);
    return arrayOfByte;
  }
  
  public boolean a(ByteBuf paramByteBuf)
  {
    int i = paramByteBuf.readableBytes();
    if (i < 6) {
      return false;
    }
    i -= 6;
    int k = paramByteBuf.readInt();
    byte[] arrayOfByte;
    if (k > 0)
    {
      if (i < k) {
        return false;
      }
      i -= k;
      arrayOfByte = new byte[k];
      paramByteBuf.readBytes(arrayOfByte);
      a(new String(arrayOfByte, j));
    }
    int j = paramByteBuf.readShort();
    if (j > 0)
    {
      if (i < j) {
        return false;
      }
      i -= j;
      arrayOfByte = new byte[j];
      paramByteBuf.readBytes(arrayOfByte);
      b(new String(arrayOfByte, j));
    }
    if (this.c != null)
    {
      if (i < 4) {
        return false;
      }
      i -= 4;
      this.d = paramByteBuf.readShort();
      j = paramByteBuf.readShort();
      if (j > 0)
      {
        if (i < j) {
          return false;
        }
        i -= j;
        arrayOfByte = new byte[j];
        paramByteBuf.readBytes(arrayOfByte);
        c(new String(arrayOfByte, j));
      }
    }
    return true;
  }
  
  public String toString()
  {
    return "RegisterRmMessage dbkey:" + this.b + ",appname:" + this.e;
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.a.b.e
 * JD-Core Version:    0.7.0.1
 */